package ph.com.gs3.formalistics.model.vo.application;

public class CommandResult<R, E> {

	public static final int STATUS_UNDEFINED = -2;
	public static final int STATUS_ERROR = -1;
	public static final int STATUS_WARNING = 0;
	public static final int STATUS_SUCCESS = 1;

	private int status;
	private String errorMessage;
	private R result;
	private E error;

	public CommandResult() {
		status = STATUS_UNDEFINED;
		errorMessage = null;
		result = null;
	}

	// ===========================================================
	// Getters & Setters

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String error) {
		status = STATUS_ERROR;
		this.errorMessage = error;
	}

	public R getResult() {
		return result;
	}

	public void setResult(R result) {
		this.result = result;
	}

	public E getError() {
	    return error;
    }

	public void setError(E error) {
	    this.error = error;
    }

}
